Color compositing using transparency groups

ABSTRACT

Methods and apparatus, including computer programs, for processing transparency attributes of digital graphics objects. The techniques result in the color compositing of an arbitrary structure of artwork elements defining the appearance of a page to produce a result color at any position on the page that is continuous with respect to all inputs.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of and claims priority toU.S. application Ser. No. 09/563,176, filed on May 2, 2000, which is adivisional of U.S. application Ser. No. 09/470,260, filed on Dec. 22,1999, now abandoned.

BACKGROUND OF THE INVENTION

The present invention is related to the compositing and blending ofdigital artwork data.

Many graphics processing computer programs, such as the AdobeIllustrator® program, available from Adobe Systems Incorporated of SanJose, Calif., build a final image of vector and/or raster artwork bycompositing two or more elements together. The elements may be thoughtof as drawn on stacked sheets of acetate. The density of the ink on theacetate controls the transparency of the sheet, i.e., the extent towhich that sheet obscures the images from the underlying sheets.

Each element typically includes artwork data and compositing controls.The elements can be represented by an array of pixels or analytically,e.g., by using shape outlines, or by other functions which map positionsto data values. In addition, the data can be dynamic, that is, computedfrom other data at the time the elements are composited.

SUMMARY OF THE INVENTION

To achieve transparency and other visual effects, a 2-D graphicalprimitive can be assigned an opacity and a blending mode in addition toa color. Conceptually, it is also possible to assign an opacity and ablending mode to a group of such primitives, to a group of such groups,and so on. The invention provides techniques that implement theseattributes in a fully general way in generating an appearance for thedocument.

In general, in one aspect, the invention provides methods and apparatus,including computer programs, for compositing a transparency group ofdigital graphics objects. The techniques include compositing atransparency group of digital graphics objects; and generating acompositing result having no pure backdrop contribution from a backdropof the group. Advantageous implementations can include the followingfeatures. The group contains a second group. The group is composited asan element of a third group. The group of objects is within a hierarchyof objects defining a page and the backdrop is defined by a compositedstate of the page before the first object of the group is processed. Thecompositing result is generated by removing the background from theresult of compositing the last object in the group.

In general, in another aspect, the invention provides methods andapparatus, including computer programs, for processing digital artwork.The techniques include receiving a hierarchical tree structure of nestedelements defining an appearance of a page, the tree including leaves,the leaves being artwork objects, the tree structure being defined bycontainer elements that contain one or more leaves, containers, or both,multiple of the elements having respective blend modes associated withthem; and compositing the structure to produce a result color at anyposition on the page, the result color being continuous with respect toall inputs when continuous blend modes are used.

In general, in another aspect, the invention provides methods andapparatus, including computer programs, for processing digital artwork.The techniques include attributing to an artwork object a separate shapeand opacity having the property that the shape times opacity is equal toa transparency alpha.

In general, in another aspect, the invention provides methods andapparatus, including computer programs, for processing a group ofdigital graphical elements in a document. The techniques includedetermining whether the group of elements is defined as a knockoutgroup; and rendering each graphical element of the group to knock outany number of contiguous elements underneath said each graphical elementwhile compositing said each graphical element transparently with therest of the document if the group is a knockout group.

In general, in another aspect, the invention provides methods andapparatus, including computer programs, for processing a group ofdigital graphical elements in a document. The techniques includedetermining whether a group of contiguous elements is designated as anisolated group; and ignoring any background color of the group whencompositing the group to calculate a resulting color if the group is anisolated group.

In general, in another aspect, the invention provides methods andapparatus, including computer programs, for calculating the opacity of atransparency group on a document page, the group having a backdropdefined on or above the page, the backdrop having an opacity, and thebeginning of the group being different from the beginning of the page.The techniques include initializing a group opacity accumulation valueto zero; processing a group stack to accumulate the opacity of everyelement of the group without regard to any opacity of the page or of anyartwork between the page and the beginning of the group; using theaccumulation value at the end of the processing as the value of theopacity of the group; and computing the opacity of the page at the topof the group from the opacity of the group and the opacity of the pageat the bottom of the group.

Advantages that can be seen in implementations of the invention includeone or more of the following. Opacities and blending modes can bespecified at all levels of the graphical object hierarchy. Thus, thereis no need to worry about whether a given piece of art already containstransparency attributes: even if it does, it can be manipulated like asimple object (i.e., one that is not part of a group). Merely groupingelements does not change the appearance of the document. The most directbenefit of this is the absence of any changes in appearance when a usergroups elements for reasons unrelated to color compositing. In addition,the appearance of the document changes gradually if any opacity value inthe hierarchy is changed gradually. Thus, the operation of opacitycontrols is intuitive and predictable. In particular, a user can fadeany set of elements gradually by first grouping them. Also, compositingoccurs only where objects exist.

The details of one or more embodiments of the invention are set forth inthe accompanying drawings and the description below. Other features andadvantages of the invention will become apparent from the description,the drawings, and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates the processing of digital artwork in accordance withthe invention.

FIG. 2 illustrates the rearrangement of an artwork stack as a tree inaccordance with the invention.

FIG. 3 shows a process for generating a composite result having no purebackground contribution.

FIG. 4 shows a process for calculating the opacity of a transparencygroup on a document page.

FIG. 5 shows a process for compositing an isolated group of elementswith a document.

FIG. 6 shows a process for compositing a knockout group of elements witha document.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

The invention provides a technology for processing transparencyattributes of any kind of viewable object in a digital graphicsprocessing system.

One can think of objects on a page of a document containing artwork asforming a stack, where the stacking order is defined to be the order inwhich the objects are specified, bottommost object first. In an opaqueimaging model (i.e., with no transparency), the color of the page at anypoint is defined to be the color of the topmost object at that point,disregarding any overlapping objects lower in the stack. This effect canbe realized simply by rasterizing objects directly to the page in theorder in which they are specified.

Under a transparency imaging model, all of the objects in a stack canpotentially contribute to the result. At any given point, the color ofthe page is defined to be the result of combining the colors of allenclosing objects in the stack, according to some compositing rules thatthe transparency model defines. The order in which objects are specifieddetermines the stacking order, but not necessarily the order in whichobjects are actually painted onto the page.

A given object is composited with a backdrop. Ordinarily, the backdropis the stack of all objects that have been specified previously. Theresult is then treated as the backdrop for compositing the next object.However, within certain kinds of groups (defined below), a differentbackdrop is chosen.

When an object is composited with the backdrop, the color at each pointis modified by a function referred to as a transfer function or a blendmode, which is a function of both the object's color and the backdropcolor. The blend mode determines how colors interact. Different blendmodes can be used to achieve a variety of useful effects. A single blendmode is in effect for compositing all of a given object, but differentblend modes can be applied to different objects.

The compositing of an object with the backdrop is mediated by two scalarquantities called shape and opacity. Conceptually, for each object,these quantities are defined at every point in the plane, just as ifthey were additional color components. (In actual practice, they areoften obtained from auxiliary sources, rather than being intrinsic tothe object itself.)

Both shape and opacity vary from 0 (no contribution) to 1 (maximumcontribution). At any point where either the shape or the opacity is 0,the color is undefined. At any point where the shape is 0, the opacityis also undefined. The shape and opacity themselves are subject tocompositing rules, so that the stack also has a shape and opacity ateach point.

An object's opacity, in combination with the backdrop's opacity,determines the relative contributions of the backdrop's color, theobject's color, and the blended color to the computed composite color.An object's shape then determines the degree to which the compositecolor replaces the backdrop color. Shape values of 0 and 1 identifypoints that lie “outside” and “inside” a familiar sharp-edged object,but intermediate values are useful in defining soft-edged objects.

Shape and opacity are very similar concepts. In most situations, theycan be combined into a single value, called alpha, which controls boththe color compositing computation and the fading between the object andthe backdrop. However, in a few situations they are treated separatelyas will be described.

One or more consecutive objects in a stack can be collected togetherinto a transparency group, which in this context will be referred tosimply as group. A group as a whole can have various properties thatmodify the compositing behavior of objects within the group and theirinteractions with the backdrop of the group. Additionally, an additionalblend mode, shape, and opacity can be associated with the group as awhole and used when compositing the group with its backdrop. Groups canbe nested within other groups, so that the group hierarchy forms a treestructure 102, as shown in FIG. 1. The tree structure 102 can be definedby one or more containers (groups), each containing one or more leaves(objects), containers (groups), or both. Note that the concept of atransparency group is independent of existing notions of “group” or“layer” in graphics applications. The tree structure 102 can becomposited (step 104) to produce a color result 106 at any position onthe page, the color result 106 being continuous with respect to allinputs.

The color result of compositing a group can be converted to asingle-component luminosity value and treated as a soft mask (or mask,for short). Such a mask can then be used as an additional source ofshape or opacity values during subsequent compositing operations. Whenthe mask is used as shape, this technique is known as soft clipping; itis a generalization of the conventional clipping path.

The current page is generalized to be a group composed of the entirestack of objects placed on the page, composited with a backdrop that iswhite and fully opaque. In contexts where a “page” is to be treated as apiece of artwork to be placed on some other page, it is not treated as apage but as a group, whose backdrop may be defined differently.

The following conventions are used for variable names used in thisspecification. In general, a lower-case letter represents a scalarquantity, such as an opacity. An upper-case letter represents an n-tupleof scalar values, such as a color.

In the descriptions of the basic color compositing computations, colorvalues are generally represented by the letter C, with a mnemonic suffixthat indicates which of several color values is being referred to; forinstance, Cs stands for “source color”. Shape and opacity values arerepresented with the letters f (for “form factor”) and q (for“opaqueness”), with a mnemonic suffix, such as qs for “source opacity.”The symbol α (alpha) stands for the product of the corresponding shapeand opacity values.

In the descriptions of group transparency, the basic formulas are recastas recurrence relations and augmented with other formulas specifyinggroup behavior. In that context, variables have a further, numericsubscript indicating the position in the stack that the quantity isassociated with, with the bottommost object numbered 0. Thus, Cs_(i)stands for “source color of the ith object in the stack”.

In certain computations, one or more variables may have undefinedvalues; for instance, when opacity is zero, the corresponding color isundefined. A value can also be undefined if it results from a divisionby zero. In any formula that uses the undefined value, the value has noeffect on the ultimate result because it is subsequently multiplied byzero or otherwise cancelled out, so any non-zero value can be used. Forconvenience, by convention, 0/0=0.

In the transparency model, the result of painting (i.e., the resultcolor) is a function of both the color being painted (the source color)and the color it is being painted over (the backdrop color). Both ofthese latter colors may vary as a function of position on the page, butfor clarity of exposition this description will treat a fixed point inthe page and assume a fixed source and backdrop color.

Other parameters in this computation are the alpha, which specifies therelative contributions of the source and backdrop colors, and the blendmode, which allows one to customize how the source and backdrop colorsare combined in the painting operation. The color compositing function,or just compositing function for short, determines the color result of apainting operation:

$\begin{matrix}{{Cr} = {{\left( {1 - \frac{\alpha\; s}{\alpha\; r}} \right) \cdot {Cb}} + {\frac{\alpha\; s}{\alpha\; r} \cdot \left( {{\left( {1 - {\alpha\; b}} \right) \cdot {Cs}} + {\alpha\;{b \cdot {B\left( {{Cb},{Cs}} \right)}}}} \right)}}} & \left( {{Eq}.\mspace{14mu} 1} \right)\end{matrix}$where the variable definitions are given in the following table.

Variable Meaning αb Backdrop alpha αr Result alpha αs Source alpha B(Cb,Cs) Function implementing the blend mode Cb Backdrop color Cr Resultcolor Cs Source color

This is actually a simplified form of the compositing function where theshape and opacity values are combined and represented as a single alphavalue. The more general form is presented later.

The compositing function operates on colors. If the colors arerepresented by more than one scalar value, then the computation treatsthem as vector quantities. To be precise, Cb, Cr, Cs, and B(Cb, Cs) willall have n elements, where n is the number of components in the colorspace used for compositing. The above formula is then a vector function:the ith component of Cr is obtained by plugging in the ith components ofCs, Cb and B(Cb, Cs).

The result of the computation will depend on the color space in whichthe colors are represented. The color space used to represent colors forthe computation is called the blending color space. When necessary,source colors are converted to the blending color space prior to thecompositing computation.

The blending and compositing formulas assume that the range per colorcomponent is from 0 to 1, and that the color space is additive. Whenblending operations are performed in subtractive color spaces, the colorcomponent values are complemented (i.e., C becomes 1−C) before the blendmode function is applied, and the results of the function are thencomplemented before being passed on. This adjustment makes the effect ofthe blend modes numerically consistent across all color spaces.

The B(Cb, Cs) term of the compositing function is used to customize theblending operation. This function of two colors is called the blendmode. Although standard functions have been defined, this could be anyfunction of the source and backdrop colors that returns another color.Generally, blend modes are defined by a scalar function that is appliedseparately to each color component, expressed in additive form:cr=B(cb,cs)where the lower-case cr, cs, and cb denote one component of the colorsCr, Cs, and Cb. Such a blend mode is called separable. This is incontrast to a function where the result for a particular component is afunction of components other than the corresponding component in thebackdrop and source colors.

The simplest blend mode, Normal, is defined by B(Cb, Cs)=Cs. With thisblend mode the compositing formula collapses to a simple weightedaverage of the source and backdrop colors, controlled by the source andbackdrop alpha values.

If the blend mode is a more interesting function of the source andbackdrop colors then the source and backdrop alphas control whether thiseffect is fully realized, or whether it is toned down by mixing theresult with the source and backdrop colors. With any blend mode, αs=0 orαb=0 results in no blend mode effect; αs=1 and αb=1 results in maximumblend mode effect.

The color compositing function (Equation 1, above) produces a resultcolor that is a weighted average of the source color, the backdropcolor, and the B(Cb, Cs) term, with the influence of the source andbackdrop colors is controlled by the source and backdrop alphas,respectively. The influence of the blend function is controlled by theproduct of the source and backdrop alphas.

Another variable, the result alpha, also appears in the function. Thisis actually a computed result, described later. The result color isnormalized by the result alpha. This ensures that when this color andalpha are subsequently used together in another compositing operation,the color's contribution will be correctly represented. If the resultalpha is zero, the result color is undefined.

The color compositing formula (Equation 1) is a simplification of thefollowing formula, which presents the relative weights of the purebackdrop contribution and the contributions of source and blended colorsin a more straightforward fashion:αr·Cr=(1−αs)·αb·Cb+(1−αb)·αs·Cs+αb·αs·B(Cb,Cs)The simplification requires a substitution based on the alphacompositing formulaαr=αb+αs−αb·αs

As indicated earlier, alpha is simply the product of shape and opacity:αb=fb·qbαr=fr·qrαs=fs·qs

The shape and opacity values can come from several sources, and inparticular from sources of type object, mask, and constant. For example,elementary objects, such as strokes, fills, and text, have an intrinsicshape, whose value is 1 for points inside the object and 0 outside.Similarly, a masked image with a binary mask has a shape that is 1 inthe unmasked portions and 0 in the masked portions. The shape of anaggregation is the union of the shapes of the objects it contains.Mathematically, elementary objects have “hard” edges, with shape valueeither 0 or 1 at any given point. However, when such objects arerasterized to device pixels, the shape values along the boundaries maytake on fractional values, representing fractional coverage of thosepixels. Similarly, elementary objects have an opacity of 1 everywhere.The opacity of an aggregation is the result of the opacity computationsfor all the objects it contains.

The range of all shape and opacity inputs is from 0 to 1, and thedefault value for all of them is 1. The intent is that the paintingoperation will become more transparent as any of the inputs goes towards0. If more than one input goes towards 0 then the result is compounded.This is achieved mathematically simply by multiplying the three inputsof each type, producing intermediate values called the source shape andthe source opacity.fs=fj·fm·fkqs=qj·qm·qkwhere the variable definitions are given the following table.

Variable Meaning fj Object shape fk Constant shape fm Mask shape fsSource shape qj Object opacity qk Constant opacity qm Mask opacity qsSource opacity

In parallel with computing a result color, the painting operation alsocomputes a result shape and a result opacity value. These values definethe shape and opacity associated with the result color.

Compositing of shape and opacity values is done by the union function:Union(b,s)=1−(1−b)·(1−s)=b+s−b·swhere b and s are the backdrop and source values of one of thecomponents. This can be thought of as an “inverted multiply”: it is justa multiply with the inputs and outputs complemented. The result tendstoward 1; if either input is 1 then the result is 1. This is ageneralization of the conventional concept of “union” for solid shapes.

The result shape and opacity are given by:

fr = Union  (fb, fs)${qr} = \frac{{Union}\mspace{14mu}\left( {{{fb} \cdot {qb}},{{fs} \cdot {qs}}} \right)}{fr}$where the variable definitions are given in the following table.

Variable Meaning fb Backdrop shape fr Result shape fs Source shape qbBackdrop opacity qr Result opacity qs Source opacity

These formulas can be interpreted as follows.

The result shape is simply the union of the backdrop and source shapes.

The result opacity is the union of the backdrop and source opacities,each of whose contribution is determined by its respective shape. Theresult is then normalized by the result shape. This ensures that whenthis shape and opacity are subsequently used together in anothercompositing operation, the opacity's contribution will be correctlyrepresented.

Because alpha is just the product of shape and opacity,αr=Union(αb,αs)

This formula can be used whenever the independent shape and opacityresults are not needed.

Below is a summary of all the computations from the previous section andthis one. They are given in an order such that no variable is usedbefore it is computed; also, some of the formulas have been rearrangedto simplify them. Recall that these computations occur at each point inthe page being painted.

Union  (b, s) = 1 − (1 − b) ⋅ (1 − s) = b + s − b ⋅ s fs = fj ⋅ fm ⋅ fkqs = qj ⋅ qm ⋅ qk fr = Union  (fb, fs) α b = fb ⋅ qb α s = fs ⋅ qsα r = Union  (α b, α s) ${qr} = \frac{\alpha\; r}{fr}$${Cr} = {{\left( {1 - \frac{\alpha\; s}{\alpha\; r}} \right) \cdot {Cb}} + {\frac{\alpha\; s}{\alpha\; r} \cdot \left( {{\left( {1 - {\alpha\; b}} \right) \cdot {Cs}} + {\alpha\;{b \cdot {B\left( {{Cb},{Cs}} \right)}}}} \right)}}$

A group is a sequence of consecutive objects in a stack that arecollected together and composited to produce a single color, shape, andopacity at each point. The result is then treated as if it were a singleobject for subsequent compositing operations. This facilitates creatingindependent pieces of artwork, each composed of many objects, and thencombining them, possibly with additional transparency effects during thecombination. Groups can be nested within other groups in a strictnesting, so that the group hierarchy forms a tree structure.

The objects of a group are treated as a separate stack, called thegroup's stack. The objects in the stack are composited against somebackdrop (which will be described later), producing a composite color,shape, and opacity for the group as a whole. The result is an objectwhose shape is the union of the shapes of all constituent objects andwhose color and opacity are the result of the compositing operations.This object is in turn composited with the group's backdrop in the usualway.

In addition to the computed color, shape, and opacity, the group as awhole can have several additional attributes:

-   -   All of the input variables that affect the compositing        computation for an object can also be applied when compositing        the group with its backdrop. These include mask and constant        shape, mask and constant opacity, and blend mode.    -   The group can be isolated or non-isolated, determining the        initial backdrop against which the group's stack is composited.    -   The group can be knockout or non-knockout, determining whether        the objects within the group's stack are composited with one        another, or only with the stack's backdrop.    -   An isolated group can specify its own blending color space,        independent of the blending color space of the group's backdrop.    -   Instead of being composited onto the current page, a group's        results can be used as a source of shape or opacity values for        creating a soft mask.

To deal with multiple objects at a time, the following notation will beused for distinguishing among them. The variables used earlier will bealtered to include a subscript that indicates the associated object'sposition in the stack. The subscript 0 indicates the initial backdrop;subscripts 1 through n indicate the bottommost through topmost objectsin an n-element stack; subscript i indicates the object that iscurrently of interest. Additionally, the b and r suffixes are droppedfrom the variables αb, Cb, fb, qb, αr, Cr, fr and qr; other variablesretain their suffixes.

This convention permits the compositing formulas to be restated asrecurrence relations among elements of a stack. For instance, the resultof the color compositing computation for object i is denoted by C_(i)(previously C_(r)). This computation takes as one of its inputs theimmediate backdrop color, which is the result of the color compositingcomputation for object i−1; this is denoted by C_(i−1) (previouslyC_(b)).

The revised formulas for a simple stack (not including any groups) are:

fs_(i) = fj_(i) ⋅ fm_(i) ⋅ fk_(i) qs_(i) = qj_(i) ⋅ qm_(i) ⋅ qk_(i)f_(i) = Union  (f_(i − 1), fs_(i)) α s_(i) = fs_(i) ⋅ qs_(i)α_(i) = Union  (α_(i − 1), α s_(i)) $q_{i} = \frac{\alpha_{i}}{f_{i}}$${C_{i} = {{\left( {1 - \frac{\alpha\; s_{i}}{\alpha_{i}}} \right) \cdot C_{i - 1}} + \frac{\alpha\; s_{i}}{\alpha_{i}}}}{\cdot \left( {{\left( {1 - \alpha_{i - 1}} \right) \cdot {Cs}_{i}} + {\alpha_{i - 1} \cdot {B_{i}\left( {C_{i - 1},{Cs}_{i}} \right)}}} \right)}$where the variable definitions are given in the following table.

Variable Meaning αs_(i) Source alpha α_(i) Result alpha (aftercompositing object i) B_(i)(C_(i−1), Cs_(i)) Function implementing theblend mode Cs_(i) Source color C_(i) Result color (after compositingobject i) fj_(i) Object shape fk_(i) Constant shape fm_(i) Mask shapefs_(i) Source shape f_(i) Result shape (after compositing object i)qj_(i) Object opacity qk_(i) Constant opacity qm_(i) Mask opacity qs_(i)Source opacity q_(i) Result opacity (after compositing object i)

As indicated earlier, the elements of a group are treated as a separatestack, the group's stack. Those objects are composited (against aselected initial backdrop, to be described), and the resulting color,shape, and opacity are then treated as if they belonged to a singleobject. The resulting object is in turn composited with the group'sbackdrop in the usual way.

This manipulation entails interpreting the stack as a tree. For ann-element group that begins at position i in the stack, it treats thenext n objects as an n-element substack, whose elements are given anindependent numbering of 1 through n. Those objects are removed from theobject numbering in the containing stack. They are replaced by the groupobject, numbered i, followed by the remaining objects that are paintedon top of the group, renumbered starting at i+1. This operation appliesrecursively to any nested groups.

FIG. 2 illustrates this rearrangement. The illustrated stack contains 6objects, S₁ through S₆, of which S₃ through S₅ belong to a group. Thisis rearranged into a tree consisting of an outer stack with elements Es₁through Es₄, where Es₃ is a group whose stack consists of elements Eg₁through Eg₃. Henceforth, the term element (denoted E_(i)) refers to amember of some group; it can itself be either an object or a group.

From the perspective of a particular element in a nested group, thereexist three different backdrops of interest.

1. Group backdrop—the result of compositing all elements up to but notincluding the first element of the group.

2. Initial backdrop—a backdrop that is selected for compositing thegroup's first element. This is either the same as the group backdrop(for a non-isolated group) or a fully transparent backdrop (for anisolated group).

3. Immediate backdrop—the result of compositing all elements of thegroup up to but not including the current element of interest.

When all elements of a group have been composited, the result is treatedas if the group were a single object, which is then composited with thegroup backdrop. (Note that this operation occurs regardless of whetherthe group backdrop or a transparent backdrop was chosen as the initialbackdrop for compositing the elements of the group. There is a specialcorrection to ensure that the backdrop's contribution to the overallresult is included only once.)

The color and opacity of a group are defined by the group compositingfunction:

C,f,α

=Composite (C_(o), α_(o), G)where the variable definitions are given in the following table.

Variable Meaning α_(o) Alpha of the group's backdrop α Computed alpha ofthe group, to be used as the object alpha when the group itself istreated as an object C_(o) Color of the group's backdrop C Computedcolor of the group, to be used as the source color when the group itselfis treated as an object f Computed shape of the group, to be used as theobject shape when the group itself is treated as an object G The group:a compound object consisting of all the elements E₁ . . . E_(n) of thegroup, i.e., the n constituent objects' colors, shapes, opacities, andblend modes

Note that the opacity is not given explicitly as an argument or resultof this function. When needed, the opacity can be computed by dividingthe alpha by the associated shape. Almost all of the computations usethe product of shape and opacity (i.e., alpha) rather than opacity byitself, so it is usually convenient to keep track of shape and alpha,rather than shape and opacity.

The result of calling the Composite function is then treated as if itwere an object, which is composited with the group's backdrop accordingto the normal formulas. In those formulas, the returned color C istreated as the source color Cs; the returned shape and alpha, f and α,are treated as the object shape and alpha, fj and αj.

The definition of the Composite function (for a non-isolated,non-knockout group) is as follows:

Initialization:fg _(o) =αg _(o) =o

For each group element E_(i) in G, i∈[1, n]:

$\left\langle {{Cs}_{i},{fj}_{i},{\alpha\; j_{i}}} \right\rangle = \left\{ {{\begin{matrix}{{Composite}\mspace{14mu}\left( {C_{i - 1},\alpha_{i - 1},E_{i}} \right)\mspace{14mu}{if}\mspace{14mu} E_{i}\mspace{14mu}{is}\mspace{14mu} a\mspace{14mu}{group}} \\\begin{matrix}{{{intrinsic}\mspace{14mu}{color}},{shape},{and}} \\{\left( {{shape} \cdot {opacity}} \right)\mspace{14mu}{of}\mspace{14mu} E_{i}\mspace{14mu}{otherwise}}\end{matrix}\end{matrix}{fs}_{i}} = {{{{fj}_{i} \cdot {fk}_{i} \cdot {fm}_{i}}\alpha\; s_{i}} = {{\alpha\;{j_{i} \cdot \left( {{fk}_{i} \cdot {qk}_{i}} \right) \cdot \left( {{fm}_{i} \cdot {qm}_{i}} \right)}{fg}_{i}} = {{{Union}\mspace{14mu}\left( {{fg}_{i - 1},{fs}_{i}} \right)\alpha\; g_{i}} = {{{Union}\mspace{14mu}\left( {{\alpha\; g_{i - 1}},{\alpha\; s_{i}}} \right)} = {{1 - {{\left( {1 - {\alpha\; g_{i - 1}}} \right) \cdot \left( {1 - {\alpha\; s_{i}}} \right)}\alpha_{i}}} = {{{Union}\mspace{14mu}\left( {\alpha_{o},{\alpha\; g_{i}}} \right)} = {{1 - {{\left( {1 - \alpha_{o}} \right) \cdot \left( {1 - {\alpha\; g_{i}}} \right)}C_{i}}} = {{\left( {1 - \frac{\alpha\; s_{i}}{\alpha_{i}}} \right) \cdot C_{i - 1}} + {\frac{\alpha\; s_{i}}{\alpha_{i\;}} \cdot \left( {{\left( {1 - \alpha_{i - 1}} \right) \cdot {Cs}_{i}} + {\alpha_{i - 1} \cdot {B_{i}\left( {C_{i - 1},{Cs}_{i}} \right)}}} \right)}}}}}}}}}} \right.$

Result:

$C = {C_{n} + {\left( {C_{n} - C_{o}} \right) \cdot \left( {\frac{\alpha_{o}}{\alpha\; g_{n}} - \alpha_{o}} \right)}}$f = fg_(n) α = ag_(n)where the variable definitions are given in the following table.

Variable Meaning αs_(i) Source alpha αg_(i) Group alpha: the accumulatedsource alphas of group elements E₁ through E_(i) only, excluding thegroup's backdrop α_(o) αj_(i) Object alpha for E_(i), i.e., the productof the object shape and object opacity. This is an intrinsic attributeof an elementary object (one that is not a group); it is a computedresult for a group. α_(i) Accumulated alpha (after compositing objecti), including the group's backdrop α_(o) B_(i)(C_(i−1), Cs_(i)) Functionimplementing the blend mode for E_(i) Cs_(i) Source color for E_(i).This is an intrinsic attribute of an elementary object; it is a computedresult for a group. C_(i) Accumulated color (after compositing objecti), including the group's backdrop E_(i) Element i of the group. This isa compound variable representing the color, shape, opacity, and blendmode parameters that either are intrinsic to the object or areassociated input variables. fj_(i) Object shape for E_(i). This is anintrinsic attribute of an elementary object (one that is not a group);it is a computed result for a group. fk_(i) Constant shape for E_(i)fm_(i) Mask shape for E_(i) fs_(i) Source shape fg_(i) Group shape: theaccumulated source shapes of group elements E₁ through E_(i) only,excluding the group's backdrop qk_(i) Constant opacity for E_(i) qm_(i)Mask opacity for E_(i)

As stated above, E_(i) is a compound variable representing an element ofa group. If the element is itself a group, it represents all theelements of that group. When Composite is called with E_(i) as anargument, this means to pass the entire group that E_(i) represents.This group is represented by the G variable inside the recursive call toComposite; it is expanded and its elements are denoted by E₁ . . .E_(n).

Note that the elements of a group are composited onto a backdrop thatincludes the group's backdrop. This is to achieve the correct effects ofthe blend modes, most of which are dependent on both the source andbackdrop colors being blended. (This feature distinguishes anon-isolated group from an isolated group, which will be discussedlater.)

Special attention should be directed to the formulas at the end thatcompute the C, f, and α results that are returned from the Compositefunction. Essentially, they remove the contribution of the groupbackdrop (which may be referred to as “the pure backdrop contribution”)from the computed results. That is, as shown in FIG. 3, the purebackdrop contribution is removed from the accumulated group shown as thebox 302 (step 304). This ensures that when the group is subsequentlycomposited with that backdrop (possibly with additional shape or opacityinputs or a different mode) (step 306), the backdrop's contribution isincluded only once.

For color, the backdrop removal is accomplished by an explicitcalculation, whose effect is essentially the reversal of compositingwith Normal blend mode. The formula is a simplification of the followingformulas that present this operation more intuitively:

${bf} = \frac{\left( {1 - {\alpha\; g_{n}}} \right) \cdot \alpha_{o}}{{Union}\mspace{14mu}\left( {\alpha_{o},{\alpha\; g_{n}}} \right)}$$C = \frac{C_{n} - {{bf} \cdot C_{o}}}{1 - {bf}}$

where bf is the backdrop fraction, that is, the relative contribution ofthe backdrop color to the overall color.

For shape and alpha, backdrop removal is accomplished by maintaining twosets of variables to hold the accumulated values. The group shape andalpha, fg_(i) and αg_(i), only the shape and alpha of the groupelements, excluding the group backdrop; their final values become thegroup results returned by Composite. The complete alpha, α_(i), includesthe backdrop contribution as well; its value used in the colorcompositing computations.

As a result of these corrections, the effect of compositing objects as agroup is the same as compositing them separately, without grouping, ifboth of the following conditions are true. First, the group isnon-isolated and has the same knockout attribute as its parent group.Second, when compositing the group's results with the group backdrop,the Normal blend mode is used and the shape and opacity inputs arealways 1.

FIG. 4 shows a process 400 for calculating the opacity of a transparencygroup on a document page 402. The group can have a backdrop defined onor above the page 402, the backdrop having an opacity, and the beginningof the group being different from the beginning of the page 402. A groupopacity accumulation value is first initialized to zero (step 404). Agroup stack is then processed to accumulate the opacity of every elementof the group without regard to any opacity of the page or of any artworkbetween the page and the beginning of the group (step 406). Theaccumulation value 408 at the end of the processing is used as the valueof the opacity of the group (step 410). The opacity of the page at anyelement of the group can be computed (step 414) from the accumulatedopacity of the group at that element 408 and the opacity of the page atthe bottom of the group 412.

An isolated group is one whose elements are composited onto a fullytransparent initial backdrop rather than onto the group's backdrop. Asshown in FIG. 5, if a group of contiguous elements in a document 502 isdesignated as an isolated group (step 504), the background color isignored (step 506) when the color for the group is computed (step 508).The resulting source color, object shape, and object alpha for the groupare independent of the group backdrop. The only interaction with thegroup backdrop occurs when the group's computed color, shape, and alphaare then composited with it (step 510).

In particular, the special effects produced by the blend mode of objectswithin the group take into account only the intrinsic colors andopacities of those objects; they are not influenced by the group'sbackdrop. For example, the Multiply blend mode—defined as Multiply (cb,cs)=cb·cs—will produce a shadowing effect upon other objects lower inthe group's stack, but it will not produce a shadow on the group'sbackdrop.

The effect of an isolated group can be represented by a simple objectthat directly specifies a color, shape, and opacity at each point. Thisso-called “flattening” of an isolated group is sometimes useful forimport and export of fully-composited artwork to other documents orfiles. Additionally, an isolated group can specify an explicit blendingcolor space.

For an isolated group, the group compositing function is altered simplyby adding one statement to the initialization:

If the group is isolated: α_(o)=o

That is, the initial backdrop on which the elements of the group arecomposited is transparent, rather than being inherited from the group'sbackdrop. This substitution also makes C_(o) undefined, but the normalcompositing formulas take care of that. Additionally, the resultcomputation for C automatically simplifies to C=C_(n), because there isno backdrop contribution to be factored out.

In a knockout group, each individual element is composited with thegroup's initial backdrop, rather than with the stack of precedingelements in the group. When objects have binary shapes (1 for “inside,”0 for “outside”), each object “knocks out” the effects of anyoverlapping elements within the same group. At any given point, only thetopmost object enclosing the point contributes to the result color andopacity of the group as a whole. As shown in FIG. 6, if a group ofcontiguous elements in a document 602 is designated as a knockout group(step 604), each element of the knockout group “knocks out” the elementunderneath it when the color for the group is computed (step 606). Ifthe group is not designated as a knockout group, a non-knockoutcomputation is performed to obtain the color for the group (step 608).Once the color for the group is computed, the group can be compositedwith the document (step 610).

This model is similar to a conventional opaque painting model, exceptthat the “topmost object wins” rule applies to both the color and theopacity. Knockout groups are useful in composing a piece of artwork froma collection of overlapping objects, where the topmost object in anyoverlap completely obscures the objects underneath. At the same time,the topmost object interacts with the group's initial backdrop in theusual way, with its opacity and blend mode applied as appropriate.

The concept of “knockout” can be generalized to accommodate fractionalshape values. In that case, the immediate backdrop is only partiallyknocked out and replaced by only a fraction of the result of compositingthe object with the initial backdrop. The compositing function isrestated to deal with knockout groups by introducing a new variable, b,which is a subscript indicating which previous result to use as thebackdrop in the compositing computations: 0 for a knockout group; i−1for a non-knockout group. When b=i−1, the formulas simplify to the onesgiven earlier.

In the general case, the computation proceeds in two stages:

1. Composite the object with the group's initial backdrop, butdisregarding the object's shape and using a source shape value of 1everywhere. This produces unnormalized temporary alpha and colorresults, αt and Ct. (For color, this computation is essentially the sameas the unsimplified color compositing formula, but using a source shapeof 1.)αt=Union(αg _(b) ,qs _(i))Ct=(1−qs _(i))·α_(b) ·C _(b) +qs _(i)·((1−α_(b))·Cs _(i)+α_(b) ·B _(i)(C_(b) ,Cs _(i)))

2. Compute a weighted average of this result with the object's immediatebackdrop, using the source shape as the weighting factor. Then normalizethe result color by the result alpha.

α g_(i) = (1 − fs_(i)) ⋅ α g_(i − 1) + fs_(i) ⋅ α tα_(i) = Union  (α_(o), α g_(i ))$C_{i} = \frac{{\left( {1 - {fs}_{i}} \right) \cdot \alpha_{i - 1} \cdot C_{i - 1}} + {{fs}_{i} \cdot {Ct}}}{\alpha_{i\;}}$

This averaging computation is performed for both color and alpha. Theabove formulas show this averaging directly. The formulas given beloware slightly altered to use source shape and alpha, rather than sourceshape and opacity, avoiding the need to compute a source opacity valueexplicitly. (Note that Ct there is slightly different from Ct above; itis premultiplied by fs_(i).)

The extreme values of the source shape produce the binary “knockout”effect. That is, a shape of 1 (“inside”) yields the color and opacitythat result from compositing the object with the initial backdrop. Ashape of 0 (“outside”) leaves the previous group results unchanged. Theexistence of the knockout feature is one reason for maintaining aseparate shape value, rather than only a single alpha value thatcombines shape and opacity. The separate shape value must be computed inany group that is subsequently used as an element of a knockout group.

A knockout group can be non-isolated or isolated; that is, isolated andknockout are independent attributes of a group. A non-isolated knockoutgroup composites its topmost enclosing element with the group'sbackdrop; an isolated knockout group composites the element with atransparent backdrop.

The following restatement of the group compositing function also takesisolated groups and knockout groups into account.

Initialization:fg_(o)=αg_(o)=o

If the group is isolated:α_(o)=o

For each group element E_(i) in G, i∈[1, n]:

$b = \left\{ {{\begin{matrix}{o\mspace{14mu}{if}\mspace{14mu}{the}\mspace{14mu}{group}\mspace{14mu}{is}\mspace{11mu}{knockout}} \\{i - {1\mspace{14mu}{otherwise}}}\end{matrix}\left\langle {{Cs}_{i},{fj}_{i},{\alpha\; j_{i}}} \right\rangle} = \left\{ {{\begin{matrix}{{Composite}\mspace{14mu}\left( {C_{b},\alpha_{b},E_{i}} \right)\mspace{14mu}{if}\mspace{14mu} E_{i}\mspace{14mu}{is}\mspace{14mu} a\mspace{14mu}{group}} \\\begin{matrix}{{{intrinsic}\mspace{14mu}{color}},{shape},{and}} \\{\left( {{shape}\mspace{14mu}{opacity}} \right)\mspace{14mu}{of}\mspace{14mu} E_{i}\mspace{14mu}{otherwise}}\end{matrix}\end{matrix}{fs}_{i}} = {{{{fj}_{i} \cdot {fk}_{i\;} \cdot {fm}_{i}}\alpha\; s_{i}} = {{\alpha\;{j_{i} \cdot \left( {{fk}_{i} \cdot {qk}_{i}} \right) \cdot \left( {{fm}_{i} \cdot {qm}_{i}} \right)}{fg}_{i}} = {{{Union}\mspace{14mu}\left( {{fg}_{i - 1},{fs}_{i}} \right)\alpha\; g_{i}} = {{{{\left( {1 - {fs}_{i}} \right) \cdot \alpha}\; g_{i - 1}} + {{\left( {{fs}_{i} - {\alpha\; s_{i}}} \right) \cdot \alpha}\; g_{b}} + {\alpha\; s_{i}\alpha_{i}}} = {{{Union}\mspace{14mu}\left( {{\alpha_{o} \cdot \alpha}\; g_{i}} \right){Ct}} = {{{\left( {{fs}_{i} - {\alpha\; s_{i}}} \right) \cdot \alpha_{b} \cdot C_{b}} + {\alpha\;{s_{i} \cdot \begin{pmatrix}{{\left( {1 - \alpha_{b}} \right) \cdot {Cs}_{i}} +} \\{\alpha_{b} \cdot {B_{i}\left( {C_{b},{Cs}_{i}} \right)}}\end{pmatrix}}C_{i}}} = \frac{{\left( {1 - {fs}_{i}} \right) \cdot \alpha_{i - 1} \cdot C_{i - 1}} + {Ct}}{\alpha_{i}}}}}}}}} \right.} \right.$

Result:

$C = {C_{n} + {\left( {C_{n} - C_{o}} \right) \cdot \left( {\frac{\alpha_{o}}{\alpha\; g_{n}} - \alpha_{o}} \right)}}$f = fg_(n) α = α g_(n)

Note that these formulas are in their most general form. They can besignificantly simplified when some sources of shape and opacity are notpresent or when shape and opacity need not be maintained separately.Furthermore, in each specific type of group (isolated or not, knockoutor not), some terms of these equations cancel or drop out. An efficientimplementation will use simplified equations.

All of the elements painted onto a page (both top-level groups andtop-level objects) that are not part of any group may be treated as ifthey were contained in a non-isolated, non-knockout group P whoseelements are composited in the usual way onto a white backdrop. Thecolor C of the page at a given point is defined by:

Cg,fg,αg

=Composite(W,1,P)C=(1−αg)·W+αg·Cg  (Eq. 2)where the variable definitions are given in the table below. The firstformula computes the color and alpha for the group given a whitebackdrop; the second composites the results with that backdrop (usingNormal blend mode). It should be noted that the second formula is notreally needed, because the C result is identical to the C, variable atthe end of execution of Composite. The second formula merely restoresthe backdrop contribution that is removed at the end of Composite.

Variable Meaning αg Computed alpha of the group C Color of the page CgComputed color of the group fg Computed shape of the group (this resultis discarded) P A group consisting of all elements E₁ . . . E_(n) in thepage's top-level stack W The color white in the page group's color space(all components 1 if the color space is additive, 0 if subtractive).

Ordinarily, the page group's color space will be the same as the nativecolor space of the output device—that is, a device color space. However,it may be useful to allow specification of an explicit color space,particularly a device-independent color space, to ensure morepredictable results. In this case, all page-level compositing is done inthat color space, with the entire result then converted to the nativecolor space of the output device. This case also arises when the page isnot actually being rendered but is converted to a “flattened”representation in an opaque imaging model, such as PostScript.

Because the page starts out fully opaque and the accumulated shape andopacity never decrease, it is unnecessary for the page group toaccumulate the result shape and opacity. This significantly simplifiesthe transparency compositing formulas; an efficient implementation willcertainly use the simplified forms. The complete Composite function forthe page group is as follows:

Initialization:C_(o)=W

For each group element E_(i) in P, i∈[1, n]:

$\left\langle {{Cs}_{i},{fj}_{i},{\alpha\; j_{i}}} \right\rangle = \left\{ {{\begin{matrix}{{Composite}\mspace{14mu}\left( {C_{i - 1},\alpha_{i - 1},E_{i}} \right)\mspace{14mu}{if}\mspace{14mu} E_{i}\mspace{14mu}{is}\mspace{14mu} a\mspace{14mu}{group}} \\\begin{matrix}{{{intrinsic}\mspace{14mu}{color}},{shape},{and}} \\{\left( {{shape} \cdot {opacity}} \right)\mspace{14mu}{of}\mspace{14mu} E_{i}\mspace{14mu}{otherwise}}\end{matrix}\end{matrix}\alpha\; s_{i}} = {{\alpha\;{j_{i} \cdot \left( {{fk}_{i} \cdot {qk}_{i}} \right) \cdot \left( {{fm}_{i} \cdot {qm}_{i}} \right)}C_{i}} = {{\left( {1 - {\alpha\; s_{i}}} \right) \cdot C_{i - 1}} + {\alpha\;{s_{i} \cdot {B_{i}\left( {C_{i - 1},{Cs}_{i}} \right)}}}}}} \right.$

The result color for the page is simply C_(n).

Earlier sections have mentioned the mask shape, fm, and mask opacity,qm, that are contributors to the source shape and opacity. These enableshape and opacity to originate from a source that is independent of theobjects being composited. A soft mask (or just mask for short) definesvalues that can vary across different points on the page. The word“soft” emphasizes that the mask value at a given point is not just 0 or1 but can take on fractional values.

A mask used as a source of shape values is also called a soft clip. Thesoft clip is a generalization of the hard clip: a hard clip can berepresented as a soft clip having opacity 1 inside and 0 outside theclipping path. Everywhere inside a hard clipping path, a source objectscolor replaces the backdrop; everywhere outside, the backdrop showsthrough unchanged. With a soft clip, on the other hand, one can create agradual transition between an object and the backdrop, such as in avignette. (Although “soft clip” suggests a vignette around an enclosedarea, in fact the value of the mask can be an arbitrary function ofposition.)

A mask is typically the only means of providing position-dependentopacity, since elementary objects do not have intrinsic opacity.

A mask can be defined by creating a group and then painting objects intoit, thereby defining color, shape, and opacity in the usual way. Theresulting group can then be treated as a mask by following one of thetwo procedures described below.

The color, shape, and opacity of the group G are first computed by theusual formula:

C,f,α

=Composite(C _(o),α_(o) ,G)where C_(o) and α_(o) are an arbitrary backdrop whose value does notcontribute to the eventual result. The C, f, and a results are thegroup's color, shape, and alpha, with the backdrop factored out.

The mask value at each point is then simply the alpha of the group. Inthis case, the group's color is not used, and thus there is no need tocompute it.

The group is composited with a fully-opaque backdrop of some selectedcolor. The mask value at any given point is then defined to be theluminosity of the resulting color. This enables the mask to be derivedfrom the shape and color of an arbitrary piece of artwork, drawn withordinary painting operators.

The color C used to create the mask from a group G is defined by:

Cg,fg,αg

=Composite(C _(o),1,G)C=(1−αg)·C_(o)+αg·Cgwhere C_(o) is the selected backdrop color. This is essentially the sameas the page group computation given in Equation 2, above, and summarizedin the table following it, except that an arbitrary backdrop color(rather than just white) can be specified. Once again, the C result isidentical to the C_(n) variable at the end of execution of Composite. Ifthe backdrop removal computation at the end of Composite is omitted,then the second formula above is not needed. G can be any kind ofgroup—isolated or not, knockout or not—with various effects in the Cresult produced in each case. The color C is then converted toluminosity in any conventional way.

The backdrop color that is most likely to be useful is black. If thebackdrop is black, any areas outside the group's shape will end up witha zero luminosity value in the resulting mask. If we view the contentsof the group as a positive mask, this result matches our expectationswith respect to the points that are outside the shape.

The invention can be implemented in digital electronic circuitry, or incomputer hardware, firmware, software, or in combinations of them.Apparatus of the invention can be implemented in a computer programproduct tangibly embodied in a machine-readable storage device forexecution by a programmable processor; and method steps of the inventioncan be performed by a programmable processor executing a program ofinstructions to perform functions of the invention by operating on inputdata and generating output. The invention can be implementedadvantageously in one or more computer programs that are executable on aprogrammable system including at least one programmable processorcoupled to receive data and instructions from, and to transmit data andinstructions to, a data storage system, at least one input device, andat least one output device. Each computer program can be implemented ina high-level procedural or object-oriented programming language, or inassembly or machine language if desired; and in any case, the languagecan be a compiled or interpreted language. Suitable processors include,by way of example, both general and special purpose microprocessors.Generally, a processor will receive instructions and data from aread-only memory and/or a random access memory. Generally, a computerwill include one or more mass storage devices for storing data files;such devices include magnetic disks, such as internal hard disks andremovable disks; magneto-optical disks; and optical disks. Storagedevices suitable for tangibly embodying computer program instructionsand data include all forms of non-volatile memory, including by way ofexample semiconductor memory devices, such as EPROM, EEPROM, and flashmemory devices; magnetic disks such as internal hard disks and removabledisks; magneto-optical disks; and CD-ROM disks. Any of the foregoing canbe supplemented by, or incorporated in, ASICs (application-specificintegrated circuits).

To provide for interaction with a user, the invention can be implementedon a computer system having a display device such as a monitor or LCDscreen for displaying information to the user and a keyboard and apointing device such as a mouse or a trackball by which the user canprovide input to the computer system. The computer system can beprogrammed to provide a graphical user interface through which computerprograms interact with users.

The invention has been described in terms of particular embodiments.Other embodiments are within the scope of the following claims. Forexample, the steps of the invention can be performed in a differentorder and still achieve desirable results.

1. A computer program product, tangibly stored on a computer-readablemedium, for compositing digital graphics objects, comprisinginstructions operable to cause a programmable processor to performoperations including: compositing a transparency group of digitalgraphics objects on a non-transparent group backdrop to generate anaccumulated result, the transparency group including two or morecontiguous digital graphics objects in a stack of digital graphicsobjects, the group backdrop being a result of compositing elements inthe stack up to but not including the first element of the transparencygroup, the compositing of the transparency group including combiningcolors specified by the group backdrop and one or more digital graphicsobjects in the transparency group such that the accumulated resultincludes a contribution of the group backdrop; removing the contributionof the group backdrop from the accumulated result to generate acompositing result for the transparency group, wherein removal of acolor contribution of the group backdrop effects a reversal ofcompositing the group backdrop with a normal blend mode.
 2. The computerprogram product of claim 1, where the accumulated result includes anaccumulated color C_(n) and removing the contribution from the groupbackdrop effecting a reversal of compositing the group backdrop with thenormal blend mode includes removing a backdrop color C_(o) of the groupbackdrop from the accumulated color based on the expression C_(n)−(bf)(C_(o)), where bf is a backdrop fraction characterizing a relativecontribution of the backdrop color to the accumulated color.
 3. Thecomputer program product of claim 1, where compositing the transparencygroup of digital graphics objects includes instructions operable tocause the programmable processor to perform operations includingcompositing a sequence of digital graphics objects in the transparencygroup, the sequence including a last object in the sequence, to generatethe accumulated result for each object in the sequence; and removing thecontribution of the group backdrop from the accumulated result includesinstructions operable to remove the color contribution from theaccumulated result after compositing the last digital graphics object inthe sequence.
 4. The computer program product of claim 1, theinstructions further operable to cause a programmable processor toperform operations including: compositing the compositing result for thetransparency group on the group backdrop using the normal blend mode togenerated an overall composited object; and rendering the overallcomposited object.
 5. A system for compositing digital graphics objectscomprising: one or more computers configured to perform operationsincluding: compositing a transparency group of digital graphics objectson a non-transparent group backdrop to generate an accumulated result,the transparency group including two or more contiguous digital graphicsobjects in a stack of digital graphics objects, the group backdrop beinga result of compositing elements in the stack up to but not includingthe first element of the transparency group, the compositing of thetransparency group including combining colors specified by the groupbackdrop and one or more digital graphics objects in the transparencygroup such that the accumulated result includes a contribution of thegroup backdrop; removing the contribution of the group backdrop from theaccumulated result to generate a compositing result for the transparencygroup, wherein removal of a color contribution of the group backdropeffects a reversal of compositing the group backdrop with a normal blendmode.
 6. The system of claim 5, where the accumulated result includes anaccumulated color C_(n) and removing the contribution from the groupbackdrop effecting a reversal of compositing the group backdrop with thenormal blend mode includes removing a backdrop color C_(o) of the groupbackdrop from the accumulated color based on the expression C_(n)−(bf)(C_(o)), where bf is a backdrop fraction characterizing a relativecontribution of the backdrop color to the accumulated color.
 7. Thesystem of claim 5, where compositing the transparency group of digitalgraphics objects includes compositing a sequence of digital graphicsobjects in the transparency group, the sequence including a last objectin the sequence, to generate the accumulated result for each object inthe sequence; and removing the contribution of the group backdrop fromthe accumulated result includes instructions operable to remove thecolor contribution from the accumulated result after compositing thelast digital graphics object in the sequence.
 8. The system of claim 5,the one or more computers further configured to perform operationsincluding: compositing the compositing result for the transparency groupon the group backdrop using the normal blend mode to generated anoverall composited object; and rendering the overall composited object.9. A method for compositing digital graphics objects comprising:compositing, using one or more computing devices, a transparency groupof digital graphics objects on a non-transparent group backdrop togenerate an accumulated result, the transparency group including two ormore contiguous digital graphics objects in a stack of digital graphicsobjects, the group backdrop being a result of compositing elements inthe stack up to but not including the first element of the transparencygroup, the compositing of the transparency group including combiningcolors specified by the group backdrop and one or more digital graphicsobjects in the transparency group such that the accumulated resultincludes a contribution of the group backdrop; removing the contributionof the group backdrop from the accumulated result to generate acompositing result for the transparency group, wherein removal of acolor contribution of the group backdrop effects a reversal ofcompositing the group backdrop with a normal blend mode.
 10. The methodof claim 9, where the accumulated result includes an accumulated colorC_(n) and removing the contribution from the group backdrop effecting areversal of compositing the group backdrop with the normal blend modeincludes removing a backdrop color C_(o) of the group backdrop from theaccumulated color based on the expression C_(n) −(bf)(C_(o)), where bfis a backdrop fraction characterizing a relative contribution of thebackdrop color to the accumulated color.
 11. The method of claim 9,where compositing the transparency group of digital graphics objectsincludes compositing a sequence of digital graphics objects in thetransparency group, the sequence including a last object in thesequence, to generate the accumulated result for each object in thesequence; and removing the contribution of the group backdrop from theaccumulated result includes instructions operable to remove the colorcontribution from the accumulated result after compositing the lastdigital graphics object in the sequence.
 12. The method of claim 9,further comprising: compositing the compositing result for thetransparency group on the group backdrop using the normal blend mode togenerated an overall composited object; and rendering the overallcomposited object.
 13. A computer program product, tangibly stored on acomputer-readable medium, for compositing digital graphics objects,comprising instructions operable to cause a programmable processor toperform operations including: receiving a stack of digital image layersfor a digital image, the stack including a transparency group and anon-transparent group backdrop for the transparency group, thetransparency group including two or more contiguous digital graphicsobjects in a stack of digital graphics objects, the group backdrop beinga result of compositing elements in the stack up to but not includingthe first element of the transparency group; compositing thetransparency group of digital graphics objects on the group backdrop togenerate an accumulated result, the compositing of the transparencygroup including combining colors specified by the group backdrop and oneor more digital graphics objects in the transparency group such that theaccumulated result includes a contribution of the group backdrop;removing the contribution of the group backdrop from the accumulatedresult to generate a compositing result for the transparency group; andcompositing the digital image, wherein the instructions to composite thedigital image include instructions to composite the compositing resultfor transparency group with the group backdrop, wherein the contributionof the group backdrop is included only once in the composited digitalimage.
 14. A system for compositing digital graphics objects comprising:one or more computers configured to perform operations including:receiving a stack of digital image layers for a digital image, the stackincluding a transparency group and a non-transparent group backdrop forthe transparency group, the transparency group including two or morecontiguous digital graphics objects in a stack of digital graphicsobjects, the group backdrop being a result of compositing elements inthe stack up to but not including the first element of the transparencygroup; compositing the transparency group of digital graphics objects onthe group backdrop to generate an accumulated result, the compositing ofthe transparency group including combining colors specified by the groupbackdrop and one or more digital graphics objects in the transparencygroup such that the accumulated result includes a contribution of thegroup backdrop; removing the contribution of the group backdrop from theaccumulated result to generate a compositing result for the transparencygroup; and compositing the digital image, wherein the instructions tocomposite the digital image include instructions to composite thecompositing result for transparency group with the group backdrop,wherein the contribution of the group backdrop is included only once inthe composited digital image.
 15. A method for compositing digitalgraphics objects comprising: receiving a stack of digital image layersfor a digital image, the stack including a transparency group and anon-transparent group backdrop for the transparency group, thetransparency group including two or more contiguous digital graphicsobjects in a stack of digital graphics objects, the group backdrop beinga result of compositing elements in the stack up to but not includingthe first element of the transparency group; compositing, using one ormore computing devices, the transparency group of digital graphicsobjects on the group backdrop to generate an accumulated result, thecompositing of the transparency group including combining colorsspecified by the group backdrop and one or more digital graphics objectsin the transparency group such that the accumulated result includes acontribution of the group backdrop; removing the contribution of thegroup backdrop from the accumulated result to generate a compositingresult for the transparency group; and compositing the digital image,wherein the instructions to composite the digital image includeinstructions to composite the compositing result for transparency groupwith the group backdrop, wherein the contribution of the group backdropis included only once in the composited digital image.